import {postRequest} from '../../util/fetch';

export const login = data =>
  postRequest('/mobile/account/login.shtml', {...data});
export const checkUserName = (username, isShow = true) =>
  postRequest('/mobile/account/checkUserName.shtml', {username}, true, isShow);
export const getCode = phone =>
  postRequest('/mobile/account/sendVerifyCode.shtml', {phone});
export const registered = data =>
  postRequest('/mobile/account/register.shtml', {...data});
export const resetUserPass = data =>
  postRequest('/mobile/account/resetUserPass.shtml', {...data});
export const verification = data =>
  postRequest('/mobile/account/checkVerifyCode.shtml', {...data});
export const update = data =>
  postRequest('/mobile/device/update.shtml', {...data}, false);
export const account = data =>
  postRequest('/mobile/account/setTradePass.shtml', {...data});
export const accountData = () => postRequest('/mobile/account/getData.shtml');
export const forgetTradePass = data =>
  postRequest('/mobile/account/forgetTradePass.shtml', {...data});
export const resetTradePass = data =>
  postRequest('/mobile/account/resetTradePass.shtml', {...data});
export const etWalletAddress = () =>
  postRequest('/mobile/wallet/getWalletAddress.shtml');
export const addOrder = data =>
  postRequest('/mobile/order/addOrder.shtml', {...data}, false);
export const checkTradePass = data =>
  postRequest('/mobile/account/checkTradePass.shtml', {...data}, false);
export const getOrders = () => postRequest('/mobile/order/getOrders.shtml');
export const addWalletAddress = data =>
  postRequest('/mobile/wallet/addWalletAddress.shtml', {...data});
export const deleteWalletAddress = id =>
  postRequest('/mobile/wallet/deleteWalletAddress.shtml', {id});
export const updateWalletAddress = data =>
  postRequest('/mobile/wallet/updateWalletAddress.shtml', {...data});
export const checkExistsPhone = phone =>
  postRequest('/mobile/account/checkExistsPhone.shtml', {phone});
export const getUserNameForPhone = data =>
  postRequest('/mobile/account/getUserNameForPhone.shtml', {...data});
export const getVerifyCode = data =>
  postRequest('/mobile/account/sendVerifyCode.shtml', {...data});
